<!DOCTYPE html>
<html>
<head>
    <title></title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList?showStudent?true:false:false">
        <div class="grid-btn">
			<#if shiro.hasPermission("exam:examination:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("exam:examination:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("exam:examination:generateRq")>
            <a class="btn btn-primary" @click="generateRq"><i class="fa fa-pencil-square-o"></i>&nbsp;发布/取消</a>
			</#if>
			<#if shiro.hasPermission("exam:examination:generateRq")>
            <a class="btn btn-primary" @click="seeRq"><i class="fa fa-pencil-square-o"></i>&nbsp;查看二维码</a>
			</#if>
			<#if shiro.hasPermission("exam:examination:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
            <#if shiro.hasPermission("exam:paperDesign:getPaperList")>
            <a class="btn btn-primary" @click="getPaperDList"><span class="glyphicon glyphicon-book"></span>&nbsp;试卷查看</a>
            </#if>
            <#if shiro.hasPermission("exam:examination:generateRq")>
            <a class="btn btn-primary" @click="getStudentList"><span class="glyphicon glyphicon-book"></span>&nbsp;学生查看</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
        			
        			<div class="form-group">
						<div class="col-sm-2 control-label">所属部门</div>
						<div class="col-sm-10">
							<input id="examinationDeptId" type="text" class="form-control" style="cursor:pointer;" v-model="examination.deptName" @click="deptTree" readonly="readonly" placeholder="所属部门"/>
						</div>
					</div>
					
                    <div class="form-group">
						<div class="col-sm-2 control-label">专业名称</div> 	
						<div class="col-sm-10">
						    <select id="majorId" v-model="examination.majorId" class="form-control" v-on:change="getPaperList(examination.majorId)">
						        <option v-for="item in majorLists" v-bind:value="item.id">{{item.majorName}}</option>
						    </select>
                        </div>
					</div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">试卷名称</div>
                        <div class="col-sm-10">
                            <!-- <input type="text" class="form-control" v-model="examination.paperId" placeholder="试卷id"/>  -->
                            
                            <select id="paperId" v-model="examination.paperId" class="form-control" v-on:change="setHighestPassScore(examination.paperId)">
						        <option v-for="item in paperList" v-bind:value="item.id">{{item.name}}</option>
						    </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">考试名称</div>
                        <div class="col-sm-10">
                            <input type="text" id="examinationName" class="form-control" v-model="examination.examinationName" placeholder="考试名称"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">考试开始时间</div>
                        <div class="col-sm-10">
                            <input id="examinationStartTime" type="text" class="form-control" v-model="examination.examinationStartTime" autocomplete="off" placeholder="考试开始时间"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">考试结束时间</div>
                        <div class="col-sm-10">
                            <input id="examinationEndTime" type="text" class="form-control" v-model="examination.examinationEndTime" autocomplete="off" placeholder="考试结束时间"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">可考次数</div>
                        <div class="col-sm-10">
                            <input id="examinationNumber" type="text" class="form-control" v-model="examination.examinationNumber" placeholder="可考次数"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">过关分数</div>
                        <div class="col-sm-10">
                            <input id="examinationPassScore" type="text" class="form-control" v-model="examination.examinationPassScore" placeholder="过关分数"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">考试时长</div>
                        <div class="col-sm-10">
                            <input id="examinationTimeLong" type="text" class="form-control" v-model="examination.examinationTimeLong" placeholder="考试时长"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">拍照次数</div>
                        <div class="col-sm-10">
                            <input id="photoTimes" type="text" class="form-control" v-model="examination.photoTimes" placeholder="拍照次数"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">可切屏次数</div>
                        <div class="col-sm-10">
                            <input id="hideCountSum" type="text" class="form-control" v-model="examination.hideCountSum" placeholder="可切屏次数"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">考试注意事项</div>
                        <div  class="col-sm-10" >
                        	<div id="examinationAttention" class="summernote" v-model="examination.examinationAttention" ></div>
                            <!-- <input id="examinationAttention" type="text" class="form-control" v-model="examination.examinationAttention" placeholder="考试注意事项"/>  -->
                        </div>
                    </div>

					<div class="form-group">
		                <div class="col-sm-2 control-label"></div>
		                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
		                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
		            </div>
        </form>
    </div>
    <div id="studentList" v-show="!showStudent" class="panel panel-default">
        <input type="button" class="btn btn-primary" @click="searchStudent" value="查询"/>
        <input type="button" class="btn btn-primary" @click="resetStudent" value="重置"/>
        <a class="btn btn-primary" @click="downLoadStudent"><span class="glyphicon glyphicon-book"></span>&nbsp;下载模板</a>
        <a class="btn btn-primary" @click="imp"><span class="glyphicon glyphicon-book"></span>&nbsp;导入学生名单</a>
        <a class="btn btn-primary" @click="autoByDeptId"><span class="glyphicon glyphicon-book"></span>&nbsp;自动生成</a>
        <a class="btn btn-primary" @click="exportStudentList"><span class="glyphicon glyphicon-book"></span>&nbsp;导出学生名单</a>
        <input type="button" class="btn btn-warning" @click="reload" value="返回"/>
        <div class="form-group col-sm-2" >
            <div class="col-sm-3 control-label">学生姓名:</div>
            <div class="col-sm-10">
                <input type="text" class="col-sm-1 form-control" v-model="userName" placeholder="学生姓名" />
            </div>
        </div>
        <!-- <div class="form-group col-sm-2">
             <input type="text" class="form-control"  v-model="q.deptName" @click="deptTree" readonly="readonly" placeholder="所属部门">
         </div>-->
        <div class="form-group col-sm-2" >
            <div class="col-sm-3 control-label">所属部门:</div>
            <div class="col-sm-10">
                <input type="text" class="col-sm-1 form-control" v-model="deptName" @click="deptTree" readonly="readonly" placeholder="所属部门">
            </div>
        </div>
        <!-- <a class="btn btn-primary" @click="exportStudentList"><span class="glyphicon glyphicon-book"></span>&nbsp;导出</a>-->
        <table id="studentJqGrid"style="width: 100%;"></table>
        <div id="studentJqGridPager"></div>
    </div>
</div>
<!-- 选择部门 -->
<div id="deptLayer" style="display: none;padding:10px;">
	<ul id="deptTree" class="ztree"></ul>
</div>

<div id="produceListLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>
<div id="impList" style="display: none;padding:10px;">
    <input :value="excel" id="file" name="file" type="file"/>
</div>

<div id="paperList" style="display: none;padding:10px;">
    <table id="paperJqGrid"></table>
    <div id="paperJqGridPager"></div>
</div>

<div id="paperInfo" style="display: none;padding:10px;">
</div>

<script src="${request.contextPath}/statics/js/modules/exam/examination.js?_${.now?long}"></script>
</body>
</html>